
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script>
    if('edit' == '<%=request.getParameter("action")%>'){
        let row = $('#dg').datagrid('getSelected');
        $.ajax({
            type:"GET",
            url:"/lab00/ServletUser?action=getone",
            data:{username:row.username},
            success:function (ret)
            {
                let result = eval("(" +ret+")");
                console.log(result.data);
                if(result.code == '200'){
                    $('#username').textbox({
                        readonly:true,
                        required:true,
                        validType: ''
                    })
                    $('#ff').form('load',result.data);
                }
                else{
                    alert(result.msg);
                }
            }
        })

    }

</script>

<form id="ff" method="post" style="padding: 5px">
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="username" name="username" style="width:85%" data-options="label:'账号:',required:true,
        validType:{
        remote:['/lab00/ServletUser?action=exists','username'] },invalidMessage:'已经存在'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="password" name="password" style="width:85%" data-options="label:'密码:'">
    </div>
</form>
